package com.lagou.rocket.demo.order.service.Impl;

import com.lagou.rocket.demo.order.model.Inventory;
import com.lagou.rocket.demo.order.repository.InventoryRepository;
import com.lagou.rocket.demo.order.service.IInventoryService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *
 * </p>
 *
 * @author KK
 * @since 2021-11-07
 */
@Service
public class InventoryServiceImpl implements IInventoryService {


    private final InventoryRepository inventoryRepository;

    public InventoryServiceImpl(InventoryRepository inventoryRepository) {
        this.inventoryRepository = inventoryRepository;
    }

    @Override
    public Inventory getInventoryByProductCode(String productCode) {
        return inventoryRepository.getInventoryByProductCode(productCode);
    }

    @Override
    public Inventory save(Inventory order) {
        return inventoryRepository.save(order);
    }
}
